﻿using Beetle;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;

internal class Class_ah : IDisposable
{
    [Class_b]
    public static string _field_a = "KntezZn3/HTLy0OE4rsKQNgpdkZpBMBet2b45vHtFqeU5lDeTdKI70zrINkgMhjlYl9lYFiTnxjOV9OfTzoBd/Cz/pdkTh2ylx0uLR2fPBQoxXaUg3BtYj83rpP3S/qMa0hkFXw6ZSTY6U2MaLRbEFMxqJo/JCEZjZkCXWGR7s+l1yek6gLbx8nGaRl9xULqnOvM1j/zlW/1iy5Uy8IJ1rZJgzpEINOmL1TFnqICCU8/KqyhUhcJYNtc6itm00GmEsEnOuAYUyTE1JoUFh/woSlQnxIl9YVDtmDWvoErCkYOqloIktDr49H3Dmhad2PtjaUyV/UDr1pG7afvcP0hPg9Bfp0LaP5Hl4mdtvNxb2ueDZObTzFkxYqYNCevbhW8ObGC8MBSwnNx5VSclsPgf9IycbD4JfDGox52jt3D0I3pEnQ13Y0JWGCvBpXAWp9NXVFtOcRvSg3GteipY5h8LRVLXbQhhI+JNgDAnjEN4V9knksdQZqCaKtaS8I5O/cK35aXf900Y4G/uNptitq9XO4ku1nWEBZMs8/WhRXDMiUV8lmSmqp64/1QoHzUUujHsJZkLcSVB0MRjZUTXcv5S97li5Vks5azk4sppeyEbp4lXWJoz9ntfkUbQSGqPB3/Zfq+pFi+W3F+bIf0GSFd6B8GarwFGQIzzDVFzCGpcjQ79VzpXOX9DIb4H8p+mW++XFLdfysuBAY1Bw9BRMjty229EaUnmh4C";
    [Class_t]
    public static string _field_b = "baxxfKKgHV9XwOpsrn1uYA==";
    public int _field_c;
    private Queue<Class_ad> _field_d;
    private Class_ad _field_e;
    private bool _field_f;

    static Class_ah()
    {
        Class_x.g();
    }

    public Class_ah()
    {
        WaitCallback callBack = null;
        this._field_c = 10;
        this._field_d = new Queue<Class_ad>(0x400);
        if (callBack == null)
        {
            callBack = new WaitCallback(this.a);
        }
        ThreadPool.QueueUserWorkItem(callBack);
    }

    protected Class_ad a()
    {
        lock (this._field_d)
        {
            if (this._field_d.Count > 0)
            {
                return this._field_d.Dequeue();
            }
            return null;
        }
    }

    public void a(Class_ad A_0)
    {
        lock (this._field_d)
        {
            if (A_0 != null)
            {
                this._field_d.Enqueue(A_0);
            }
        }
    }

    [CompilerGenerated]
    private void a(object A_0)
    {
        this.e();
    }

    protected virtual void b()
    {
        this._field_e = this.a();
        if (this._field_e != null)
        {
            try
            {
                using (this._field_e)
                {
                    this._field_e.a();
                }
            }
            catch
            {
            }
        }
        else
        {
            Thread.Sleep(this._field_c);
        }
    }

    public int d()
    {
        return this._field_d.Count;
    }

    public void Dispose()
    {
        lock (this)
        {
            if (!this._field_f)
            {
                while (this._field_d.Count > 0)
                {
                    this._field_d.Dequeue().Dispose();
                }
                this._field_f = true;
            }
        }
    }

    public virtual void e()
    {
        if (!TcpUtils.ExecutionContext)
        {
            ExecutionContext.SuppressFlow();
        }
        while (!this._field_f)
        {
            this.b();
        }
    }
}

